package com.itheima_9;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;

public class test_9_3 {
    public static void main(String[] args) {
        String s="1998-09-09";
        String s1="2021-09-09";
        DateTimeFormatter pa = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        LocalDate parse = LocalDate.parse(s, pa);
        LocalDate parse1 = LocalDate.parse(s1, pa);
        long between = ChronoUnit.YEARS.between(parse,parse1);
        System.out.println(between);

    }
}
